package bch.rocketmq;

import org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

// 持久化 顺序 堆积 幂等 推拉 通信
@SpringBootApplication
@EnableScheduling
@EnableTransactionManagement
@Import(RocketMQAutoConfiguration.class)
@ServletComponentScan
public class RocketmqApplication {

    private static final Logger log = LoggerFactory.getLogger(RocketmqApplication.class);

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(RocketmqApplication.class, args);
        Runtime.getRuntime().addShutdownHook(new Thread(() -> log.info("JVM shutdown hook")));
    }

}
